<template>
    <nav-container class="withdraw-center" :nav="nav">
        <keep-alive>
            <router-view></router-view>
        </keep-alive>
    </nav-container>
</template>

<script>
export default {
  name: 'withdraw-center',
  data() {
    return {
        nav: [
            {
                title: "提现",
                to: {
                    name: 'withdraw-put-forward'
                }
            },
            {
                title: "资金明细",
                to: {
                    name: 'withdraw-trade'
                }
            }
        ]
    };
  },
  computed:{
      ...mapState({
          user: state => state.user
      }),
  },
  created(){
      if(this.user.rechargeSwitch){
          this.nav.unshift({
              title: "充值",
              to: {
                  name: 'recharge-center'
              }
          });
      }
  }
};
</script>

